package com.itheima;

import java.util.Scanner;

public class Login {
    public static void main(String[] args) {
        String user = "abd";
        String password = "123456";
        String ur, pwd;
        Scanner sc = new Scanner(System.in);
        System.out.println("Please input user name :");
        ur = sc.nextLine();
        System.out.println("Please input password:");
        pwd = sc.nextLine();

        for (int i = 1; i <= 3; i++) {

            if (user.equals(ur) && password.equals(pwd)) {
                System.out.println("Please Login !");
                break;
            } else {

                if (3 -i == 0) {
                    System.out.println("Account blocked !");
                    break;
                } else {
                    System.out.println("Your password is wrong,you can also try " + (3 - i) + " times.");
                    System.out.println("Please input password again :");
                    pwd = sc.nextLine();
                }
            }
        }
    }
}